<?php

namespace App\Models;

use App\Traits\WorkerMysqlConnect;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class gonggao extends Model
{
    use HasFactory;
    use WorkerMysqlConnect;

    protected $table = 'gonggao';

    /**
     * 获取单条公告信息
     * @return array
     */
    public static function getGonggao()
    {
        return self::connectWorker()->select('content')->row();
    }

    /**
     * 获取所有公告
     * @return mixed|string|null
     */
    public static function getAllGonggao()
    {
        return self::connectWorker()->select('content')->query();
    }
}
